package trans.model.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the user table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="user"
 */

public abstract class BaseUser  implements Serializable {

	private static final long serialVersionUID = 1L;
	public static String REF = "User";
	public static String PROP_USER_CODE = "UserCode";
	public static String PROP_PASSWORD = "Password";
	public static String PROP_FAX = "Fax";
	public static String PROP_STATUS = "Status";
	public static String PROP_USER_ROLE = "UserRole";
	public static String PROP_USERNAME = "Username";
	public static String PROP_ADDRESS = "Address";
	public static String PROP_CREATE_TIME = "CreateTime";
	public static String PROP_ID = "Id";
	public static String PROP_USER_COMP_NAME = "UserCompName";
	public static String PROP_SOP = "Sop";
	public static String PROP_TEL = "Tel";
	public static String PROP_ICON = "Icon";


	// constructors
	public BaseUser () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUser (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String username;
	private java.lang.String password;
	private java.lang.Integer userRole;
	private java.lang.Integer status;
	private java.lang.String fax;
	private java.lang.String tel;
	private java.lang.String userCode;
	private java.lang.String userCompName;
	private java.lang.String address;
	private java.lang.String icon;
	private java.util.Date createTime;
	private java.lang.String sop;

	// collections
	private java.util.List<trans.model.UserTips> userTips;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * @param password the password value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: user_role
	 */
	public java.lang.Integer getUserRole () {
		return userRole;
	}

	/**
	 * Set the value related to the column: user_role
	 * @param userRole the user_role value
	 */
	public void setUserRole (java.lang.Integer userRole) {
		this.userRole = userRole;
	}



	/**
	 * Return the value associated with the column: status
	 */
	public java.lang.Integer getStatus () {
		return status;
	}

	/**
	 * Set the value related to the column: status
	 * @param status the status value
	 */
	public void setStatus (java.lang.Integer status) {
		this.status = status;
	}



	/**
	 * Return the value associated with the column: fax
	 */
	public java.lang.String getFax () {
		return fax;
	}

	/**
	 * Set the value related to the column: fax
	 * @param fax the fax value
	 */
	public void setFax (java.lang.String fax) {
		this.fax = fax;
	}



	/**
	 * Return the value associated with the column: tel
	 */
	public java.lang.String getTel () {
		return tel;
	}

	/**
	 * Set the value related to the column: tel
	 * @param tel the tel value
	 */
	public void setTel (java.lang.String tel) {
		this.tel = tel;
	}



	/**
	 * Return the value associated with the column: user_code
	 */
	public java.lang.String getUserCode () {
		return userCode;
	}

	/**
	 * Set the value related to the column: user_code
	 * @param userCode the user_code value
	 */
	public void setUserCode (java.lang.String userCode) {
		this.userCode = userCode;
	}



	/**
	 * Return the value associated with the column: user_comp_name
	 */
	public java.lang.String getUserCompName () {
		return userCompName;
	}

	/**
	 * Set the value related to the column: user_comp_name
	 * @param userCompName the user_comp_name value
	 */
	public void setUserCompName (java.lang.String userCompName) {
		this.userCompName = userCompName;
	}



	/**
	 * Return the value associated with the column: address
	 */
	public java.lang.String getAddress () {
		return address;
	}

	/**
	 * Set the value related to the column: address
	 * @param address the address value
	 */
	public void setAddress (java.lang.String address) {
		this.address = address;
	}



	/**
	 * Return the value associated with the column: icon
	 */
	public java.lang.String getIcon () {
		return icon;
	}

	/**
	 * Set the value related to the column: icon
	 * @param icon the icon value
	 */
	public void setIcon (java.lang.String icon) {
		this.icon = icon;
	}



	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * @param createTime the create_time value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}



	/**
	 * Return the value associated with the column: sop
	 */
	public java.lang.String getSop () {
		return sop;
	}

	/**
	 * Set the value related to the column: sop
	 * @param sop the sop value
	 */
	public void setSop (java.lang.String sop) {
		this.sop = sop;
	}



	/**
	 * Return the value associated with the column: userTips
	 */
	public java.util.List<trans.model.UserTips> getUserTips () {
		return userTips;
	}

	/**
	 * Set the value related to the column: userTips
	 * @param userTips the userTips value
	 */
	public void setUserTips (java.util.List<trans.model.UserTips> userTips) {
		this.userTips = userTips;
	}

	public void addTouserTips (trans.model.UserTips userTips) {
		if (null == getUserTips()) setUserTips(new java.util.ArrayList<trans.model.UserTips>());
		getUserTips().add(userTips);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof trans.model.User)) return false;
		else {
			trans.model.User user = (trans.model.User) obj;
			if (null == this.getId() || null == user.getId()) return false;
			else return (this.getId().equals(user.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}